<template>
  <view class="home-main">
    <hx-navbar ref="hxnb" :config="config" @clickBtn="onClickBtn" />
    <view class="cont">
      <view class="nav-list margin-top">
        <navigator
          open-type="navigate"
          hover-class="none"
          :url="item.title"
          :class="'nav-li bg-kuxuan' + (index+1)"
          v-for="(item, index) in kuxuan"
          :key="index"
        >
          <view class="nav-name">{{item.name}}</view>
        </navigator>
      </view>
    </view>
  </view>
</template>
<script>
import hccmConfig from "@/common/hccm-config.js"
import mRequest from "@/api/index";
export default {
  data() {
    return {
      config: {
        title: "准考证及报告",
        color: "#ffffff",
        back: false,
        //背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
        backgroundColor: [1, ["#00b99e", "#25bba4", "#00e5c3", "#06eeca"]],
        // 滑动屏幕后切换颜色，注意颜色为数组时长度必须一样，还有使用滑动切换必须监听 onPageScroll 事件
        slideBackgroundColor: [0, ["#a9a1ff", "#6970ff", "#ff55ff", "#ff9999"]],
        // 状态栏 ，数组则为滑动变色
        statusBarBackground: ["", "#ffffff"],
        rightButton: [
        ]
      },
      kuxuan: [
        {
          title: "/pages/downLoadPDF",
          name: "查看准考证并下载",
          color: ""
        },
        {
          title: "/pages/downLoadReport",
          name: "下载考试报告",
          color: ""
        },
        {
          title: "/pages/downLoadExam",
          name: "下载考试成绩单",
          color: ""
        }
      ]
    };
  },
  onLoad(){
  },
  onPageScroll(e) {
    // 重点，用到滑动切换必须加上
    // this.$refs.hxnb.pageScroll(e);
  },
  methods: {
    onClickBtn(data) {
      //console.log(data);
      uni.showToast({
        title: `key为 ${data.key} 的按钮`,
        icon: "none",
        duration: 1300
      });
    },
  }
};
</script>
<style lang='scss'>
.nav-list {
  display: flex;
  flex-wrap: wrap;
  padding: 0px 40upx 0px;
  justify-content: center;
}

.nav-li {
  padding: 30upx;
  border-radius: 12upx;
  width: 45%;
  margin: 0 2.5% 40upx;
  background-image: url('@/static/img/nav-bg.png');
  background-size: cover;
  background-position: center;
  position: relative;
  z-index: 1;
}

.nav-li::after {
  content: "";
  position: absolute;
  z-index: -1;
  background-color: inherit;
  width: 100%;
  height: 100%;
  left: 0;
  bottom: -10%;
  border-radius: 10upx;
  opacity: 0.2;
  transform: scale(0.9, 0.9);
}

.nav-li.cur {
  color: #fff;
  background: rgb(94, 185, 94);
  box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
}

.nav-name {
  font-size: 28upx;
  text-transform: Capitalize;
  margin-top: 20upx;
  position: relative;
}

.nav-name::before {
  content: "";
  position: absolute;
  display: block;
  width: 40upx;
  height: 6upx;
  background: #fff;
  bottom: 0;
  right: 0;
  opacity: 0.5;
}

.nav-name::after {
  content: "";
  position: absolute;
  display: block;
  width: 100upx;
  height: 1px;
  background: #fff;
  bottom: 0;
  right: 40upx;
  opacity: 0.3;
}

.nav-name::first-letter {
  font-weight: bold;
  font-size: 36upx;
  margin-right: 1px;
}

.title-header {
  display: flex;
  height: 120rpx;
  font-size: 40rpx;
  padding-bottom: 40rpx;
  align-items: center;
  justify-content: center;
  /* padding: 40rpx 0 0 0; */
  font-weight: bold;
}
.title-text {
  // background-image: -webkit-linear-gradient(60deg, $u-primary, $u-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bg-kuxuan1 {
  background-color: #2196F3;
  color: #fff;
}

.bg-kuxuan2 {
  background-color: #00897B;
  color: #fff;
}

.bg-kuxuan3 {
  background-color: #1565C0;
  color: #fff;
}

.bg-kuxuan4 {
  background-color: #3F51B5;
  color: #fff;
}
.bg-kuxuan5 {
  background-color: #3fa7b5;
  color: #fff;
}
.slot-content1{
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  .title{
    font-size: 24px;
    font-weight: 600;
    padding-bottom: 16px;
  }
}
</style>
<style lang='scss'>
.home-main {
  width: 100vw;
  height: 100vh;
  overflow: auto;
  .cont {
    margin: 20rpx;
    background: #00b99e10;
    padding: 20rpx;
    border-radius: 8rpx;
  }
}
</style>